added ugly hack to better handle large input space