main functionality working, some polishing left