more functions added... still working in final version