added position parameter for displaying code