Fixed some syntax mistakes and conditions :)