Added cleaned up code