moving lgoic to server
compare rect working on server