Adding license and added own implementation of onlayout