few more modifications and testing