code ported

should use CamelCase for sub names?