expanded and added structs, added much serial calc code