lot of changes but it is working now :)