got most of the code down, program closes instantly when ran but it's a start