formatted the code a bit better