refactored; added TODO's
added main method for easier debugging