Fixed server, works, but still needs improving