add in the first version of cosin filter,will need to clean up
for user