Its working now! Still needs some cleaning up though