Performed more testing, added more constants and few more error checking