Solved by Noam_Salomonski in post #10 
              
              
                I asked on Stack Overflow and got this answer. 
If something should be added or subtracted from it, please let me know. 
Otherwise, I will accept it here as well.