Completed and Tested Cast

Check testing_cast.php for implementation