simplified the code a bit more