convert pseudo code to visual basic