Moved license to the top of the file. Added dynamicPort rule and fixed test.