due to the fork by quaz3l I took his advice and changed many things