Cleaned up code a bit, made function and variable names be consistant