removed some extraneous logic