Refactored code; removed comments for now; better first iteration working