cleaned up the code a bit to delete unnecessary return statements