License to misc.cs
Lots of stuff copied from other source