Ready for lab testing
Minor refactoring for readability
initial