Refractored the server code and made some changes (MP-Update day 1)