Edited to correct form function