Revampped code to make it my own