Fixed Fragments and cleaned code