fixed crappy code after testing