cleaned up powerbash. shrunk code and made dynamic