Debugged logic, X coord working, needs fine-tuning