initial version along with loads of changes