Fixed adapter placement
Fixed lapfunction in main