widget positioning

made widget positioning smarter.