Border and grid layout added, fixed minor bugs