NEED TO BE DEBUGGED