added features and ported to powershell