Added code for vertical correction