debugged to make more android friendly