cleaned up code just a tad