cleaned code a tad