Cleaned things up a little based on tito's advice