Code cleaned up, ready for testing!