not extensively tested - added ramping option