added lots of changes to make layout fit to container