moved all global varibles in to sinlge file