Code optimazation, Grid lines bug fixed.