using a weak hashmap for memoisation
fixed the warnings in the build file