cleaned-up source code