Adding spacing variable
Updating spacing calculation to take spacing into account