working on semantic analysis

the current code is very redundant and very messy but it's a start