Some fixes and layout changes

This will not run from anywhere but eclipse I tried fixing it but can't
get it to work