changed from static to non-static and done some TODO