code refactoring using list and stack for columns
removed local variables
implemented can put method
removed unused code
identify connections in a column