Fixed griding logic and added styling