Refined some code
Coordinates replaced with ratios for consistency across devices