initial commit. it is an editor script so it's ugly code and probably won't ever be made too pretty ;)