removing bs and fixing variables