cleaned code a tiny bit