added main block of code. almost finished
added main block of code. still testing. almost done