Made use of frequency parameter

Also updated JavaDoc.